package com.lan;


import java.io.IOException;
import java.io.InputStream;

public class Script {

    public static void main(String[] args) throws Exception {
        InputStream is = Thread.currentThread().getContextClassLoader().getResourceAsStream("base/23_1.jsl");
        String script = read(is);
        ScriptCompiler compiler = new ScriptCompiler();
        compiler.compile(script);

    }

    private static String read(InputStream is) throws IOException {
        StringBuilder sb = new StringBuilder();
        byte buffer[] = new byte[1024];
        int n = -1;
        while ((n = is.read(buffer, 0, 1024)) != -1) {
            sb.append(new String(buffer, 0, n, "UTF-8"));
        }
        return sb.toString();
    }
}
